package lib

import (
	"goloader"
	"time"
)

// Ptrtime 设置time库指针
func Ptrtime(symPtr map[string]uintptr) {
	goloader.RegTypes(symPtr, time.ANSIC, time.Nanosecond, time.January, time.Sunday)
	goloader.RegTypes(symPtr, time.Local, time.UTC)
	goloader.RegFunc(symPtr, "time.After", time.After)
	goloader.RegFunc(symPtr, "time.Sleep", time.Sleep)
	goloader.RegFunc(symPtr, "time.Tick", time.Tick)
	goloader.RegFunc(symPtr, "time.ParseDuration", time.ParseDuration)
	goloader.RegFunc(symPtr, "time.Since", time.Since)
	goloader.RegFunc(symPtr, "time.Until", time.Until)
	goloader.RegFunc(symPtr, "time.FixedZone", time.FixedZone)
	goloader.RegFunc(symPtr, "time.LoadLocation", time.LoadLocation)
	goloader.RegFunc(symPtr, "time.LoadLocationFromTZData", time.LoadLocationFromTZData)
	goloader.RegFunc(symPtr, "time.NewTicker", time.NewTicker)
	goloader.RegFunc(symPtr, "time.Date", time.Date)
	goloader.RegFunc(symPtr, "time.Now", time.Now)
	goloader.RegFunc(symPtr, "time.Parse", time.Parse)
	goloader.RegFunc(symPtr, "time.ParseInLocation", time.ParseInLocation)
	goloader.RegFunc(symPtr, "time.Unix", time.Unix)
	goloader.RegFunc(symPtr, "time.AfterFunc", time.AfterFunc)
	goloader.RegFunc(symPtr, "time.NewTimer", time.NewTimer)
	goloader.RegTypes(symPtr,
		time.Month(0),
		&time.ParseError{},
		&time.Ticker{},
		time.Duration(0),
		&time.Location{},
		&time.Time{},
		&time.Timer{},
		time.Weekday(0))
}
